<template>
  <h1>一个人的信息</h1>
  <h1>姓名：{{ jobObj.name }}</h1>
  <h1>年龄：{{ jobObj.age }}</h1>
  <button @click="test">测试触发hello自定义事件</button>
  <slot></slot>
</template>

<script>
import { reactive } from "vue";

export default {
  name: "App",
  props: ["msg", "school"],
  emits: ["hello"],
  setup(props, context) {
    console.log("---setup---", props, context);

    let jobObj = reactive({
      name: "lwt",
      age: 18,
    });

    function test() {
      context.emit("hello", 666);
    }

    return {
      jobObj,
      test,
    };
  },
};
</script>

<style>
</style>
